//
//  EarningsAdTableViewCell.swift
//  LeTu
//
//  Created by g1 on 2024/3/7.
//

import UIKit
import BUAdSDK

class EarningsAdTableViewCell: UITableViewCell {

    private var adView: BUMCanvasView?
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }
    
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        
        configUI()
    }
    
    static func getEarningsAdCellHeight() -> CGSize {
        return CGSize(width: screenFixationWidth, height: screenHeight-Size.navigationBarHeight-Size.tabBarHeight)
    }
    
    func setAdView(_ adView: BUMCanvasView) {
        
        if let adView = self.adView {
            adView.removeFromSuperview()
        }
        
        self.adView = adView
        contentView.addSubview(adView)
        
        adView.center = contentView.center
    }
    
    // MARK: - configUI
    func configUI() {
        
    }
    private lazy var backView: UIView = {
        let backView = UIView()
        return backView
    }()
    
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}
